#define _CRT_SECURE_NO_WARNINGS 1
#include<vector>
#include<algorithm>
#include<iostream>
#include<unordered_map>
using namespace std;
////class Solution {
////public:
////    vector<int> searchRange(vector<int> nums, int target)
////    {
////        vector<int> ans{-1,-1};
////        int left = 0, right = nums.size();
////        while (left < right)
////        {
////            int mid = (left + right) / 2;
////            if (nums[mid] >= target) right = mid;
////            else  left = mid + 1;
////        }
////        if (nums[left] == target)
////        ans[0] = left;
////        left = 0, right = nums.size();
////        while (left < right)
////        {
////            int mid = (left + right + 1) / 2;
////            if (nums[mid] > target) right = mid - 1;
////            else  left = mid;
////        }
////        if(nums[left]==target)
////        ans[1] = left;;
////        return ans;
////    }
////};
////int main()
////{
////    Solution s;
////    s.searchRange({ 5,7,7,8,8,8,8,10 }, 8);
//////}
////class Solution {
////public:
////    int missingNumber(vector<int> nums)
////    {
////        int left = 0, right = nums.size() - 1;
////        sort(nums.begin(), nums.end());
////        while (left < right)
////        {
////            int mid = left + (right - left + 1) / 2;
////            if (nums[mid] == mid)left = mid+1;
////            else right = mid;
////        }
////        return left;
////    }
////};
////int main()
////{
////    Solution s;
////    s.missingNumber({ 3,0,1 });
////}
////class Solution {
////public:
////    int subarraySum(vector<int>& nums, int k) {
////        unordered_map<int, int> hash;
////        int sum = 0, num = 0;
////        hash[0] = 1;
////        for (auto ch : nums)
////        {
////            sum += ch;
////            num += hash[sum - k];
////            hash[sum]++;
////        }
////        return num;
////    }
////};
//int main()
//{
//	unordered_map<int, int> hash;
//	hash[1] = 4;
//	cout << hash.count(1);
//}
//class Solution {
//public:
//    int findMaxLength(vector<int> nums)
//    {
//        unordered_map<int, int> hash;
//        hash[0] = -1;
//        int sum = 0, lenth=0;
//        for (auto& ch : nums)
//        {
//            if (ch == 0)
//                ch = -1;
//        }
//        for (int i = 0; i < nums.size(); i++)
//        {
//            sum += nums[i];
//            if (hash.count(sum)) lenth = max(lenth, i - hash[sum]);
//            if (hash.count(sum)==0) hash[sum] = i;
//        }
//        return lenth;
//    }
//};
//int main()
//{
//    Solution s;
//    s.findMaxLength({ 0, 0, 1, 0, 1 });
//}#include <iostream>
//using namespace std;
//int main()
//{
//    string s;  cin >> s;
//    int left = -1, right = 0;
//    while (right < s.size())
//    {
//        if (right == s.size() - 1 || s[right] != s[right + 1])
//        {
//            s[++left] = s[right];
//            if (left > 0 && s[left] == s[left - 1]) left--;
//        }
//        else if (s[right] == s[right + 1])
//            right++;
//        right++;
//    }
//    if (left == -1)  cout << 0;
//    else
//    {
//        string s1(s.begin(), s.begin() + left);
//        if (s1 == "") cout << 0;
//        cout << s1;
//    };
//}
#include <climits>
#include <iostream>
#include<algorithm>
#include<vector>
using namespace std;
void dfs(int& ans, vector<int>& a, int cost, size_t step)
{
    if (step > a.size())
        return;
    if (step == a.size()) {
        ans = min(ans, cost);
        return;
    }
    dfs(ans, a, cost + a[step], step + 1);
    dfs(ans, a, cost + a[step], step + 2);
}
int main() {
    int a=0, ans = INT_MAX;
    vector<int> b;
    for (int i = 0; i < a; i++) {
        int c;
        cin >> c;
        b.push_back(c);
    }
    dfs(ans, b, 0, 0);
    cout << ans;
}
